home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / developer-tools / andere sprachen / python-1.3 / readme < prev    next >
Text File  |  1996-07-16  |  16KB  |  382 lines

  1.  
  2.  
  3.                            PYTHON 1.3 RELEASE 4
  4.                           NOTES ON THE AMIGA PORT
  5.  
  6.                        Release date: July 2, 1996.
  7.  
  8.     
  9.            Conversion and Amiga specific code by Irmen de Jong.
  10.               (Original code by Guido van Rossum and others)
  11.  
  12.  
  13.  
  14.                    Read the file <DISCL_and_COPYRIGHT>!
  15.  
  16.    It contains the disclaimer for this software, and copyright notices.
  17.  
  18.  
  19.  
  20.     Contents:
  21.     ~~~~~~~~~
  22.  
  23.     1. What's new?    
  24.     2. General remarks.
  25.     3. Troubleshooting.
  26.     4. Future.
  27.     5. Modification history.
  28.  
  29.  
  30. +----------------------+
  31. |                      |
  32. |  1. What's new?      |
  33. |                      |
  34. +----------------------+
  35.  
  36. IMPORTANT CHANGES SINCE THE PREVIOUS VERSION (9-Apr-96):
  37.  
  38. * Fixed bugs:
  39.     rewrote env handling (os.environ etc) and environ module
  40.     now using correct pool library
  41.     removed debug message in os.link
  42.     removed memory leak bug in lstat
  43.     fixed os.curdir string
  44.     fixed import, now accepts paths like 'RAM:' in sys.path
  45.     fixed return value of chown function
  46.     fixed time.strftime arguments
  47.     better stack management
  48.  
  49. * Completed filesystem link support in amigamodule.
  50.   You  now  have  os.link,  os.symlink  and os.readlink.  So you can now make
  51.   hardlinks  and  softlinks, using os.link and os.symlink, respectively.  You
  52.   can  read  the  value of a symbolic (soft) link using os.readlink.  Bear in
  53.   mind  that  the  filesystem  must  support links (2.04+ FFS does) All three
  54.   functions are designed for compatibility with their Posix equivalents.
  55.  
  56.   NOTE:   because  of  implementation  issues, os.readlink fails when passing
  57.   only  a  device  name  as argument.  This is not a big problem (devices can
  58.   never be links anyway).
  59.  
  60. * Included  latest  cgi.py and urllib.py modules.  The old versions are still
  61.   available as cgi.py_old and urllib.py_old.
  62.  
  63. * Tempfile's tempdir is now 'T:' instead of current dir.
  64.  
  65. * Moved some modules in the lib directory to 'NON-Amiga'.
  66.  
  67. * Replacement   modules  for  `posixpath'  and  `posix'.   They  just  import
  68.   `amigapath' and `amiga' but make some other files work!
  69.  
  70. * Added fullpath function in ospath/amigapath module.
  71.  
  72. * Improved  mkdir  function:   now  actually pays attention to the protection
  73.   flags (and even your umask).
  74.  
  75. * Rewrote amiga.listdir with dos.library calls (smaller & faster)
  76.  
  77. * Improved select module; select.select() now takes an optional 5th argument,
  78.   which  is  a  signal  mask  to  wait  on (select is now done using AmiTCP's
  79.   WaitSelect()  ).   When  the  signal mask is not zero, select will return a
  80.   4-tuple  (instead  of  the  usual  3-tuple) in which the 4th element is the
  81.   signal mask of the signals that occured.  If no signals occured it is zero,
  82.   ofcourse.   Hint:   pass `None' for the 4th argument (timeout value) if you
  83.   want no timeouts.
  84.  
  85. * Better stack management:
  86.     - Increased stack in Python icon to 20000.
  87.     - Increased default stack to 18000. (15000 was too small for me)
  88.     - Added explicit stack check code. You'll now get a MemoryError
  89.       exception instead of a crash, hopefully :-)
  90.  
  91. * Included recent FAQ: Version: 1.29++, 7 March 1996
  92.  
  93.  
  94.    1A. About the new environment handling:
  95. --------------------------------------------------------
  96.  
  97.     DESCRIPTION OF ENVIRONMENT BUG, AND THE FIXES
  98.  
  99. Mike  Meyer  (mwm@contessa.phone.net)  told me that the new way of handling
  100. the  environment  variables  broke the portability of CGI scripts.  This is
  101. because  the  local  environment  variables  have  been  removed  from  the
  102. os.environ  dictionary.   Mike's  problem  convinced me that this was a Bad
  103. Move (tm) and thus I decided to re-do the environment handling.
  104.  
  105.     REWRITE OF ENVIRONMENT HANDLING
  106.  
  107. The  os.environ  dictionary  now  (again!) cointains BOTH GLOBAL (ENV:) AND
  108. LOCAL  (shell-)  variables.   This fixes the CGI portability problems.  The
  109. following relevant dictionaries are now defined:
  110.  
  111. os.environ       - contains both global (ENV:) and local vars (! CHANGED !)
  112.                    If a variable occurs both as global and as local var,
  113.                    the local value is taken.
  114. os.globalvars    - contains GLOBAL (ENV:) variables ONLY  (! NEW !)
  115. os.shellvars     - contains LOCAL (shell-) variables ONLY
  116. os.shellaliases  - contains shell aliases
  117.  
  118.  
  119.     REWRITE OF THE environment MODULE
  120.  
  121. Because  this module is not defined in the Python docs I assume there is no
  122. requirement  for it being Posix compliant or portable.  Hence I rewrote the
  123. whole module.  It now consists of:
  124.  
  125. putenv      - putenv(str)      !!! CHANGED !!!
  126.               DOES: Put new global (ENV:) environment variable.
  127.               ARGS: str: string of the form "name=value".
  128.               RETURNS: nothing.
  129.               NOTE: The previous putenv calls (putenv("name","value") should
  130.                     be changed to: setenv("name","value",1)
  131. getenv      - value=getenv(name)
  132.               DOES: Get value of global (ENV:) environment variable.
  133.               ARGS: string which is the variable to get.
  134.               RETURNS: value of the variable (string), or None if the var
  135.                        doesn't exist.
  136. setenv      - setenv(name,value,overwrite)
  137.               DOES: Set global (ENV:) environment variable.
  138.               ARGS: name=name of variable to set (string)
  139.                     value=value for this var (string)
  140.                     overwrite=boolean flag (0/1) indicating if the value
  141.                               should be overwritten if the var already exists.
  142.               RETURNS: nothing.
  143. unsetenv    - unsetenv(name)
  144.               DOES: removes a global (ENV:) environment variable.
  145.               ARGS: string which is the name of the var to remove
  146.               RETURNS: nothing.
  147.  
  148. setvar      - setvar(name,value,overwrite)
  149.               DOES: see setenv, but on local (shell) var instead of global!
  150. getvar      - getvar(name)
  151.               DOES: see getenv, but on local (shell) var instead of global!
  152. unsetvar    - unsetvar(name)
  153.               DOES: see unsetenv, but on local (shell) var only, not global!
  154.  
  155.  
  156. All  7 functions are implemented using the dos.library's variable calls, to
  157. keep  code  short.  Empty environment variables ('' - the empty string) are
  158. also accepted.
  159.  
  160.  
  161. +----------------------+
  162. |                      |
  163. |  2. General remarks  |
  164. |                      |
  165. +----------------------+
  166.  
  167. * All tests in Lib/test ran successfully with my version.
  168.   To try it yourself, type:
  169.   cd Python:lib/test
  170.   //Python
  171.   (now enter `import autotest' at the prompt. Should report 'all tests OK')
  172.  
  173. * To  check  some  command  line  options,  use  the -?  option, or any other
  174.   unrecognised option.
  175.  
  176. * The  default  PYTHONPATH  is  ";Python:lib",  so  when looking for modules,
  177.   python first checks the current directory, then Python:lib.  By setting the
  178.   global  environment  variable  PYTHONPATH to f.i.  "WORK:pylib", the module
  179.   search   path   becomes   WORK:pylib,  then  the  current  directory,  then
  180.   Python:lib.
  181.  
  182. * The  `Docs'  directory  contains  2 text files regarding regular expression
  183.   syntax,  and  some  other  documents.   You might want to copy other python
  184.   documentation in here.
  185.  
  186. * The following modules are built in into this release:
  187.     amiga, array, binascii, crypt, environment, grp, imp,
  188.     marshal, math, md5, new, pwd, regex, rotor, select, socket,
  189.     soundex, strop, struct, sys, syslog, time.
  190.   Amiga specific: amiga (amiga version of posix module)
  191.   Needs usergroup.library: crypt, grp, pwd.
  192.   Needs AmiTCP's bsdsocket.library: select, socket, syslog.
  193.  
  194.   Check the python documentation to see what each module offers.
  195.  
  196. * Mail  me  if  you encounter any Amiga specific problems, or if you have any
  197.   Amiga  related  questions  about  Python,  or  just  for fun.  More general
  198.   questions are better asked on the usenet newsgroup comp.lang.python.  A lot
  199.   of   information,   including  an  online  manual,  can  be  obtained  from
  200.   <http://www.python.org/>  or  <http://www.cwi.nl/www.python.org/>  if  your
  201.   site is close to the Netherlands.  Read the FAQ before asking!
  202.  
  203.  
  204.    2A. About the networking support (through AmiTCP):
  205. --------------------------------------------------------
  206.  
  207. The  python  binary is compiled with AmiTCP support.  The interpreter still
  208. works  even  if  you don't have AmiTCP, but the extra functionality (mainly
  209. the  socket  module)  can't be used without AmiTCP (obviously).  Some extra
  210. functions  already work if you only have the usergroup.library, and not the
  211. full  AmiTCP  package:   the  crypt,  pwd  and grp modules for instance.  A
  212. MultiuserFileSystem-compatible  usergroup.library  can  be  found on Aminet
  213. (didn't try it -- beware).  Usergroup.library can also be found in the demo
  214. version of AmiTCP, which is also on Aminet.
  215.  
  216.    2B. About os.path.split (amigapath.split):
  217. --------------------------------------------------------
  218.  
  219. The documentation for this function differs a bit from the unix behavior:
  220.  
  221. " Split a path in head (everything up to the last '/' or ':') and tail (the
  222. rest).  If the path ends in '/' or ':', tail will be empty.  If there is no
  223. '/'  or  ':'  in  the path, head will be empty.  DIFFERENCE WITH posixpath:
  224. only  ONE  trailing '/' will be stripped from head!  (on the Amiga a double
  225. slash  means  "parent  dir"!   ) This means that if head ends in a '/', you
  226. MUST  add  a  '/'  to it when reconstructing the path, or you will lose the
  227. "parent  dir"  slash.   Functions  that  depend  on  this function are also
  228. affected!  (basename, dirname) "
  229. (Suggested by Kent Polk, kent@eaenki.nde.swri.edu)
  230.  
  231.    2C. About Timezones:
  232. --------------------------------------------------------
  233.  
  234. As  another  side-effect  of  linking  in AmiTCP stuff, Python extracts the
  235. timezone information from your current locale preferences.  No need anymore
  236. for a TZ environment var.  (One small problem:  the name of the timezone is
  237. no longer known, and is replaced by '???'.) If the locale prefs couldn't be
  238. read, the timezone information is taken from ENV:TZ, which must be a string
  239. like 'MET-1' (MET, -1 hour from GMT).
  240.  
  241.  
  242. +-----------------------+
  243. |                       |
  244. |  3. Troubleshooting   |
  245. |                       |
  246. +-----------------------+
  247.  
  248. * When  I  try  to  install  Python,  I  get  "Unable  to  open  your tool
  249.   'installer'"!
  250.  
  251.   The Installer® utility is required for installation, but it is not included
  252.   in  the  archive.  You can find it on your original installation disks that
  253.   came with your computer (or copy it from somewhere else).  You must copy it
  254.   to your C:  directory, or somewhere else where the Workbench can find it.
  255.  
  256. * When I start python, I get "This program requires a math co-processor"!
  257.  
  258.   You have installed the wrong version. Choose the version with IEEE math.
  259.  
  260. * Python seems so slow!
  261.  
  262.   This  is  because Python is an interpreted language.  Some programs execute
  263.   slow because of this.  Other programs can run fast, because they are written
  264.   better, or make heavy use of the fast built-in (compiled) modules. Keep in
  265.   mind that function calls in Python have quite big overhead.
  266.  
  267. * I   get   "Couldn't   open   bsdsocket.library"   or   "Couldn't   open
  268.   usergroup.library" errors!
  269.  
  270.   You  are  trying to use functions that need one of these libraries.  AmiTCP
  271.   is required if you want to use all (network) functions.
  272.  
  273. * Python crashes when executing complex (recursive) code!
  274.  
  275.   Your  stack  size  is too low.  Python sets it's stack to 18K if your stack
  276.   size  setting  is  less  than  that.   In some (rare) cases, 18K may not be
  277.   enough.   Increase  the stack size in such cases.  The needed stack depends
  278.   on  the  complexity  of  the  program.  Python was compiled without dynamic
  279.   stack-checking  because  I  didn't  want  to  slow it down.  However, since
  280.   release 4 you'll get a MemoryError exception instead of a crash (hopefully)
  281.   if your stack appears too small.
  282.  
  283.  
  284. +----------------------+
  285. |                      |
  286. |  4. Future           |
  287. |                      |
  288. +----------------------+
  289.  
  290. An  experimental  high-level  Python  <->  AREXX interface is being tested.
  291. This  will  be  major!   Imagine  controlling  your  apps  from Python, and
  292. controlling Python from AREXX!
  293.  
  294. Currently  I  am  busy  extending  the interpreter with an API to the Amiga
  295. shared  libraries.   In the end this will result in a bunch of modules, one
  296. for  each  library, providing the Amiga Python programmer with an interface
  297. to  the Amiga shared libraries.  Because I ran into some problems regarding
  298. C  structures, C strings and C pointers, and their integration into Python,
  299. the release of all this is delayed some time (unknown).  Sorry.
  300.  
  301. Support for I-Net 225, another networking package, is considered.
  302.  
  303. IMPORTANT:
  304. Please  let  me  know if you find an error, encounter problems, or have any
  305. suggestions!  But, as I do this in my spare time, don't expect miracles...
  306.  
  307.  
  308. +---------------------------+
  309. |                           |
  310. |  5. Modification history  |
  311. |                           |
  312. +---------------------------+
  313.  
  314. 10 dec. 1995 - 1st public release.
  315. 13 dec. 1995 - 2nd public release.
  316.         Darn. 1st version was compiled with a wrong version of
  317.         memory pools library (Caused crash/wrong behavior on
  318.         anything less than Kick 3.0) -- FIXED (uses amiga.lib now).
  319.  
  320. 10 jan. 1996 - internal
  321.     * Phew. Added (a lot of) prototypes; the whole thing now compiles
  322.       with register arguments instead of stack arguments!
  323.     * Removed binascii module (who uses this?)
  324.     * Implemented os.popen and os.pipe (though the latter is of very
  325.       little use without fork() or threads).
  326.     * Implementes os.execv using Execute(). A bit of a hack; python only
  327.       quits after the new command finished.
  328. 2 apr. 1996 - internal
  329.     * Added AmiTCP support!
  330.     * Added many builtin modules, including binascii again ;)
  331.     * amigapath.py library module (os.path) changed, especially the split
  332.       function and the expanduser function. Check the source for details.
  333.     * Replaced lib/stat.py by original version (Unix-compatible)
  334.     * Fixed typo in 'usage' text ('colon separated'->'semicolon separated')
  335.     * Some bugfixes. Most notably in environment module, and socket module.
  336.     * Enhanced environment module.
  337.     * Removed amiga.pipe (it is useless without threads) and amiga._exit.
  338.       Separated global & local environment dictionaries, and added a
  339.       shell aliases dictionary.
  340.  
  341. 7 apr. 1996 - 3rd public release.
  342.     * Some minor changes. Fixed startup code to work with memory pools,
  343.       also when started from Workbench.
  344.     * Improved Installer® script.
  345.  
  346. 20 may 1996 - internal
  347.     * Fixed bugs:
  348.         rewrote env handling (os.environ etc) and environ module
  349.         now using correct pool library
  350.         removed debug message in os.link
  351.         removed memory leak bug in lstat
  352.     * Completed the filesystem links support in amigamodule.
  353.  
  354. 2 july 1996 - 4th public release.
  355.     * Fixed bugs:
  356.         fixed os.curdir string
  357.         fixed import, now accepts paths like 'RAM:' in sys.path
  358.         fixed return value of chown function
  359.         fixed time.strftime arguments
  360.     * Included  latest  cgi.py and urllib.py modules.
  361.     * Tempfile's tempdir is now 'T:' instead of current dir.
  362.     * Moved some modules in the lib directory to 'NON-Amiga'.
  363.     * Replacement modules for `posixpath' and `posix'.
  364.     * Added fullpath function in ospath/amigapath module.
  365.     * mkdir now actually pays attention to the protection flags and umask.
  366.     * Rewrote amiga.listdir with dos.library calls (smaller & faster)
  367.     * Improved select module; select.select() now takes an optional 5th
  368.       argument, which is an AmigaDOS signal mask to wait on.
  369.     * Better stack settings:
  370.         - Increased stack in Python icon to 20000.
  371.         - Increased default stack to 18000. (15000 was too small for me)
  372.         - Added explicit stack check code. You'll now get a MemoryError
  373.           exception instead of a crash, hopefully :-)
  374.     * Included more recent FAQ: Version: 1.29++, 7 March 1996
  375.  
  376.  
  377.  
  378.  
  379.                     Irmen de Jong
  380.                     (irmen@cs.vu.nl)
  381.  
  382.